import { useIDBKeyval } from '@vueuse/integrations/useIDBKeyval'

const { data: currentApi } = useIDBKeyval('currentApi', {
  key: 0,
  name: '默认',
  url: 'http://172.201.1.41:8001',
})

export const useSelectApiStore = defineStore({
  id: 'selectApi',
  state: () => ({
    currentApi,
  }),
  actions: {
    setCurrentApi(api) {
      currentApi.value = api
    },
  },
})
